package com.hogae.capital.service.impl;

import java.util.List;
import com.hogae.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hogae.capital.mapper.CapAccountRecordMapper;
import com.hogae.capital.domain.CapAccountRecord;
import com.hogae.capital.service.ICapAccountRecordService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 资金账户明细Service业务层处理
 * 
 * @author hogae
 * @date 2021-02-26
 */
@Service
@Transactional(rollbackFor=Exception.class)
public class CapAccountRecordServiceImpl implements ICapAccountRecordService 
{
    @Autowired
    private CapAccountRecordMapper capAccountRecordMapper;

    /**
     * 查询资金账户明细
     * 
     * @param id 资金账户明细ID
     * @return 资金账户明细
     */
    @Override
    public CapAccountRecord selectCapAccountRecordById(Long id)
    {
        return capAccountRecordMapper.selectCapAccountRecordById(id);
    }

    /**
     * 查询资金账户明细列表
     * 
     * @param capAccountRecord 资金账户明细
     * @return 资金账户明细
     */
    @Override
    public List<CapAccountRecord> selectCapAccountRecordList(CapAccountRecord capAccountRecord)
    {
        return capAccountRecordMapper.selectCapAccountRecordList(capAccountRecord);
    }

    /**
     * 新增资金账户明细
     * 
     * @param capAccountRecord 资金账户明细
     * @return 结果
     */
    @Override
    public int insertCapAccountRecord(CapAccountRecord capAccountRecord)
    {
        capAccountRecord.setCreateTime(DateUtils.getNowDate());
        return capAccountRecordMapper.insertCapAccountRecord(capAccountRecord);
    }

    /**
     * 修改资金账户明细
     * 
     * @param capAccountRecord 资金账户明细
     * @return 结果
     */
    @Override
    public int updateCapAccountRecord(CapAccountRecord capAccountRecord)
    {
        capAccountRecord.setUpdateTime(DateUtils.getNowDate());
        return capAccountRecordMapper.updateCapAccountRecord(capAccountRecord);
    }

    /**
     * 批量删除资金账户明细
     * 
     * @param ids 需要删除的资金账户明细ID
     * @return 结果
     */
    @Override
    public int deleteCapAccountRecordByIds(Long[] ids)
    {
        return capAccountRecordMapper.deleteCapAccountRecordByIds(ids);
    }

    /**
     * 删除资金账户明细信息
     * 
     * @param id 资金账户明细ID
     * @return 结果
     */
    @Override
    public int deleteCapAccountRecordById(Long id)
    {
        return capAccountRecordMapper.deleteCapAccountRecordById(id);
    }
}
